<template>
  <div id='main' style="width: 100%;height: 280px">
  </div>
</template>

<script>
  import jsonp from 'jsonp'
  import echarts from 'echarts'
  import option from './epidemic_situation_option.js'
  import 'echarts/map/js/china'//导入地图
  export default {
    name: 'chart',
    data() {
      return {
        provinceList: [],
      }
    },
    mounted() {
      /* jsonp(url,回调函数); */
      jsonp('https://interface.sina.cn/news/wap/fymap2020_data.d.json', (error, responseData) => {
        console.log(responseData);
        this.provinceList = responseData.data.list;
        this.tim = responseData.data.times
        option.series[0].data = this.provinceList.map(
        p=>{return{name:p.name,value:p.econNum}}
        )
        echarts.init(this.$el).setOption(option);
      });

    }

  }
</script>

<style>
</style>
